package modele;

import java.io.Serializable;

public class Position implements Serializable{
	private static final long serialVersionUID = 4553477449723926980L;
	private int c;
	private int l;

	public Position(int numLigne, int numCol) {
		assert numCol >= 0;
		assert numLigne >=0;
		
		l = numLigne;
		c = numCol;
	}
	
	public void allerVersLeHaut()
	{
		l++;
	}
	
	public void allerVersLeBas()
	{
		l--;
	}
	
	public void allerVersLaDroite()
	{
		c++;
	}
	
	public void allerVersLaGauche()
	{
		c--;
	}
	
	
	public String toString()
	{
		return new String("("+c+","+l+")");
	}
	
	
	
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + c;
		result = prime * result + l;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Position other = (Position) obj;
		if (c != other.c)
			return false;
		if (l != other.l)
			return false;
		return true;
	}

	public int getC() {
		return c;
	}

	public void setC(int numCol) {
		this.c = numCol;
	}

	public int getL() {
		return l;
	}

	public void setL(int numLigne) {
		this.l = numLigne;
	}
	
	
}
